import os
import random

rl = ['水果', '烟酒', '粮油', '肉蛋', '蔬菜']

if not os.path.exists('data/tmp'):
    os.mkdir('data/tmp')

for i in range(1, 11):
    prefix = '%03d' % i
    mid = random.choice(rl)
    suffix = ''.join(random.choice('0123456789ABCDEF') for _ in range(9))
    filename = prefix + mid + suffix + '.txt'
    pathname = os.path.join('data/tmp/', filename)

    if os.path.exists(pathname):
        continue
    with open(pathname, 'w', encoding='utf-8') as f:
        pass


